package cn.itcast.nems.oldems.service.impl;

import cn.itcast.nems.base.dao.entity.Paymentchannel;
import cn.itcast.nems.base.dao.mapper.PaymentchannelMapper;
import cn.itcast.nems.oldems.service.PaymentchannelService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author czq
 * @since 2024-02-28
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class PaymentchannelServiceImpl extends ServiceImpl<PaymentchannelMapper, Paymentchannel> implements PaymentchannelService {
    @Override
    public List<Paymentchannel> list(String schoolId, String name) {
        return lambdaQuery().eq(Paymentchannel::getUsestate, 1)
                .eq(Paymentchannel::getSchoolId, schoolId)
                .like(StringUtils.hasText(name), Paymentchannel::getName, name).list();
    }

    @Override
    public Paymentchannel getById(String id) {
        return baseMapper.selectById(id);
    }
}
